package com.example.demo.mapper;

import com.example.demo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Hsu琛君珩
 * @ClassName:MessageMapper
 * @date 2023-12-30
 * @apiNote
 * @Version: v1.0
 */

//这是来自MyBatis的
@Mapper
public interface MessageMapper {

    @Insert("insert into message_info (`from`,`to`,`message`)" +
            " values(#{from},#{to},#{message})")
    public void insertMessage(MessageInfo messageInfo);

    @Select("select * from message_info where delete_flag=0")
    List<MessageInfo> selectAllMessage();
}
